<html>
<head>
	<title>Database Documentation</title>
	<link rel="stylesheet" href="style/documentation.css" type="text/css">
</head>
<body>
<span class="pageHeader"><a name="introduction">Jive Forums Database Setup</a></span>
<p>

Jive Forums stores all data in a back-end database that you must setup and manage. 
This document provides setup instructions for all of the currently supported databases. 

<p>
JDBC drivers are required for Jive to communicate with your database. Suggested
drivers for particular databases are noted below where applicable. However, 
<b>the JDBC-ODBC bridge will not work with Jive under any circumstances</b>. For a full
list of available JDBC drivers, please see:
<a href="http://industry.java.sun.com/products/jdbc/drivers">http://industry.java.sun.com/products/jdbc/drivers</a>

<p>Choose your database from the list below
for setup details:
<ul>
	<li> <a href="#mysql">MySQL</a>
	<li> <a href="#oracle">Oracle 8</a>
	<li> <a href="#sqlserver">Microsoft SQLServer</a>
	<li> <a href="#postgres">PostgreSQL</a>
	<li> <a href="#interbase">Interbase 6</a>
	<li> <a href="#db2">IBM DB2</a>
	<!--
	<li> Sybase<sup><font color="red">*</font></sup>
	<li> <a href="#instantdb">InstantDB</a>
    <li> Hypersonic SQL<sup><font color="red">*</font></sup>
	-->
</ul>
<!--
<p><i><sup><font color="red">*</font></sup> = no documentation available at this time.</i>
<p> -->
Note that the list of currently supported list of databases in Jive 2.0 is rather small compared to Jive 1.2.x. This is simply due to the fact that we do not have every database installed locally for testing. If you have Sybase, DB2, InstantDB, HyperSonic SQL, SAPDb, Solid, or any other Jive 1.2.x supported DB, please consider sending <a href="mailto:matt@jivesoftware.com">matt@jivesoftware.com</a> an updated schema (please follow the format of the other 2.0 schemas rather than trying to update old schemas).

<p>
	
<span class="pageHeader"><a name="mysql">MySQL</a></span>
<ul>
	<b>JDBC Drivers</b><p>

	A free JDBC driver for mySQL that has been thoroughly tested with Jive can
	be found at:
	<p>
	<a href="http://mmmysql.sourceforge.net/">http://mmmysql.sourceforge.net/</a>
	<p>
	You should refer to this page for driver documentation and
	updates. Please use version 2.0.4 or higher.
	<p>
	In the Jive setup tool, use the following values:<p><ul>
		<li>driver: <tt>org.gjt.mm.mysql.Driver</tt>
		<li>server: <tt>jdbc:mysql://[YOUR_HOST]/[DATABSE_NAME]</tt>
	</ul><p>
		
	where [YOUR_HOST] and [DATABASE_NAME] are the actual values for you server.
	In many cases <code>localhost</code> is a suitable value for [YOUR_HOST] when
	your database is running on the same server as your webserver.

	<p><b>Setup Instructions</b><p>
	<ol>
		<li>Make sure that you are using MySQL 3.23.2 or later and the 
		MyISAM table type (default).
		<li>Create a database for the Jive tables:<br>
	    <code>mysqladmin create [databaseName]</code><br>
	    (note: "databaseName" can be something like 'Jive')

	    <li>Import the schema file:<br>
	    Unix/Linux: <code>cat Jive_mysql.sql | mysql [databaseName];</code>
		<br>   
        Windows: <code>type Jive_mysql.sql | mysql [databaseName];</code>
		
		<li>Start the Jive setup tool, and use the appropriate JDBC connection
			settings.
	</ol>
	
	
	<p><b>Further Help</b><p>

	If you need help setting up MySQL, refer to the 
	following sites:<p>
	
	<a href="http://www.mysql.com/doc.html">http://www.mysql.com/doc.html</a><br>
	<a href="http://www.devshed.com/Server_Side/MySQL">http://www.devshed.com/Server_Side/MySQL</a>           
</ul>
<p><span class="pageHeader"><a name="oracle">Oracle</a></span><p><ul>

	Your first step should be to create a "Jive" user or some other user
	that will "own" the Jive tables. This isn't necessary, but doing so
	will allow your tables to exist in a seperate tablespace. In any case, the
	Jive tables are prepended with "jive" so none of them should conflict
	with table names you have in existing tablespaces.
	<p>
	I imported the Jive tables though sqlplus. Started by copying the 
	"Jive_oracle_8.sql" file to the same directory where sqlplus is
	(should be something like /Oracle/Ora81/bin/). Next, you should log
	into sqlplus and then use the command:<br>
		<code>@ Jive_oracle_8</code><br>
	That will import the schema file. Your database is now setup.

</ul>

<p><span class="pageHeader"><a name="sqlserver">SQL Server</a></span><p><ul>
	<b>JDBC Drivers</b><p>

	Unfortunately, no freely available driver for SQL Server is high-quality enough
	to work with Jive. Specifically, the "Free-TDS" driver on freetds.org will <b>not
	currently work</b>. Many users turn to the JDBC-ODBC bridge instead; however, that
	will not work either as noted above. Do not bother to even try either driver!<p>
	
	Instead, use one of the many commercial drivers for SQLServer that are listed
	on the <a href="http://industry.java.sun.com/products/jdbc/drivers">Sun site</a>.
	Connection settings in the Jive setup tool for specific drivers are as follows:
	<p><ul>
	<b>Merant DataDirect</b><p><ul>
		
		<li>driver -- <tt>com.merant.datadirect.jdbc.sqlserver.SQLServerDriver</tt>
		<li>server -- <tt>jdbc:sqlserver://[YOUR_IP]:[PORT_NUMBER]</tt>
	</ul>
	<p>
	where [YOUR_IP] is the IP address of your database server, and [PORT_NUMBER] is the
	port that SQLServer is listening on (normally 1433).
	</ul>

	<p><b>Setup Instructions</b><p>
	<ol>
		<li>Create a new database using Enterprise Manager if you do not already have
	   		a database you want to use. You may wish to name the database "jive".
		<li>Create a user to access the database if you do not already have one you'd
			like to use. Consider making the default database for the user be the
			one you created in step 1.
		<li>Open the Query Analyser and connect to the server.
		<li>Select the database you want to use for Jive from the DB drop down (the
	   		one you created in step 1 if you're using a new database).
		<li>Open the [jive]/database/Jive_sqlserver_7.sql file.
		<li>Press F5 to run the script. The script will run and create the
			necessary tables.
		<li>Proceed to the Jive setup tool and use the appropriate JDBC settings
			when prompted.
</ul> 

<span class="pageHeader"><a name="postgres">PostgreSQL</a></span>
<ul>
	<b>JDBC Drivers</b>
	<p>
	JDBC Drivers for PostgreSQL can be found in various distribution packages
	at <a href="http://www.postgresql.org" target="_blank">PostgreSQL's Home Page</a>. 
	This installation in particular refers to <code>&quot;jdbc7.0-1.2.jar&quot;</code> driver for
	accessing PostgreSQL 7.0.3. Refer to the JDBC documentation at that site
	for more information. A couple of notes, however:
	<ul>
	  <li>The correct driver name to use when running Jive's admin setup is
	  <code>&quot;org.postgresql.Driver</code>. The documentation is apparently a little
	  out of date and omits the <code>&quot;org&quot;</code>.
	  <li>The JDBC URL format, including host and port, is:
	  <code>&quot;jdbc:postgresql://host:port/dbname&quot;</code>. The documentation
	  omits the <code>&quot;:&quot;</code> between the host and port.
	</ul>
	<p>
	<b>Setup Instructions</b>
	<p>
	<ol>
	  <li>Create the database. For example, using the 
	  	PostgreSQL <code>&quot;createdb&quot;</code> utility:
	  	<br>
	  	<code>createdb jive</code>
	  <li>Import the schema. Use psql (or your favorite Postgres sql 
	  	utility) to import the Jive database schema:
	  	<br>
	  	<code>psql -d jive -f Jive_postgres.sql</code>
	  <li>Proceed to Jive setup and use the appropriate JDBC settings when
	  	prompted.
	  
	</ol>
</ul>

<p><span class="pageHeader"><a name="interbase">Interbase 6.0</a></span><p><ul>	

	<b>JDBC Drivers</b>
	<p>
	JDBC drivers and other files for Interbase can be downloaded at
	<a href="http://www.borland.com/devsupport/interbase/opensource/" target="_blank">
	http://www.borland.com/devsupport/interbase/opensource/</a>. The JDBC
	JAR file is called interclient.jar, and should be put in the classpath of
	your application server.
	<p>
	Values for the admin tool are:
	<ul>
		<li>driver: <code>interbase.interclient.Driver</code>
		<li>server: <code>jdbc:interbase://host/fullpath</code>
	</ul>
	
	<p>
	<b>Setup Instructions</b>
	<p>
	<ol>
	  	<li>Create a new database by connecting to your Interbase server with 
		IBConsole then use the Database/Create Database menu option.
		<li>Execute the Jive SQL script using Interactive SQL. This can be 
			started from the Tools/Interactive SQL menu. Within Interactive SQL 
			load the Jive_interbase_6.sql script (Query/Load Script) and execute 
			it (Query/Execute). The database will now have been constructed.  
	</ol>
	<p>
	Notes: It would probably be a good idea to create a new user for Jive or 
	at least to change the password. 
	<p>
	To use JDBC with interbase you have to have install the Interbase
	InterServer which enables the InterClient JDBC driver to access the
	database.	
</ul>


<p><span class="pageHeader"><a name="db2">IBM DB2 7</a></span><p><ul>

	<b>JDBC Drivers</b>
	<p>
	Use the JDBC 1.2 compliant driver, db2java.zip (1293KB),
	located in the <nobr>"%DB2PATH%\java2"</nobr> directory.
	<p>
	Values for the admin tool are:
	<ul>
		<li>driver: <code>COM.ibm.db2.jdbc.app.DB2Driver</code>
		<li>server: <code>jdbc:db2:[DB NAME, e.g. JIVE]</code>
	</ul>
	<p>
	<b>Setup Instructions</b>
	<p>
	You have to create a new database (e.g. JIVE) or use an existing 
	one. Connect to the database using any valid username allowed to create
	tables and indexes. Keep in mind that DB2 UDB applies the user name 
	as the table schema. Use the same user when you configure Jive with
	the administration interface. Commands are as follows:
	<p>
	<code>DB2 CREATE DB JIVE ALIAS JIVE<br>
	DB2 CONNECT TO JIVE USER [DBUSER] USING [DBPASSWORD]</code><br>
	(or you can use the Command Center GUI)
	<p>
	Start the DB2 command window (in Windows), or the user's shell in 
	Unix and import the schema with:<p>
		<code>db2 -tvf Jive_db2_7.sql</code>
	<p>
	Or, use the DB2 Command Center and run the script
	through the "Replication Sources" folder in the Database tree.
	
	<p>
	The database is now setup.

</ul>
<!--
<p><span class="pageHeader"><a name="instantdb">Instant DB</a></span><p><ul>	
	Instant DB is an Open Source all-Java database. Find more information at
	<a href="http://instantdb.enhydra.org/">http://instantdb.enhydra.org</a>
	<p>
	First you have to create a database properties file describing 
	the	location of tables, indexes and temp files (see included example 
	Jive_instant_db.properties as a guide).<p>

	Instant DB does not have an administration interface, but includes a
	scripting tool called ScriptTool, located in the examples directory.<p>

	You will use the scripting tool to create the database. Check the 
	line #12 of Jive_1_0_instant_db.sql, and replace the path to find the 
	IDB properties file.<p>
	<code>jdbc:idb=/[path_to]/Jive_instant_db.properties</code>
	
	<p>
	Include Instant DB's jar files in the CLASSPATH, and then import 
	the schema with the scripting tool:<p>
	
	<code>java org.enhydra.instantdb.ScriptTool /[path_to]/Jive_instant_db.sql</code>

	<p>
	The database is now setup.
	<p>
	Remember to include the InstantDB JAR files in the classpath of your 
	application server:
	<ul>
		<li>idbexmpl.jar
		<li>idb.jar
	</ul>
	<p>
	The name of the JDBC driver and server node for configuring Jive are:<p>
		<code>driver=org.enhydra.instantdb.jdbc.idbDriver<br>
		server=jdbc:idb=/[path_to]/Jive_instant_db.properties</code>
</ul>
-->
</body>
</html>
